# #===============for循环===============
# #===============第一种================
# print('=-='*10,'for循环第一种','=-='*10)
# for row in range(1,10):
#     #生成行坐标：row
#     for col in range(1,row+1):
#         # 生成列坐标：col，列号取值在当前行数里即col<=row,range(1,row+1)表示取1到row之间的数值
#         print('{}X{}={:<2}'.format(row, col, row * col), end='  ')
#     print(' ')
# print('=-='*25)
#
# # ===============第二种================
# print('=-='*10,'for循环第二种','=-='*10)
# for row in range(9,0,-1):
#     #倒数生成行坐标：row,-1:代表步进
#     for col in range(1,row+1):
#         # 生成列坐标：col，列号取值在当前行数里即col<=row,range(1,row+1)表示取1到row之间的数值
#         print('{}X{}={:<2}'.format(row, col, row * col), end='  ')
#     print(' ')
# print('=-='*25)
#
# #===============第三种================
# print('=-='*10,'for循环第三种','=-='*10)
# for row in range(1,10):
#     #生成行坐标：row
#     for col in range(1,10):
#         if row > col:
#             print('{:<6}'.format(''), end='  ')
#         else:
#             print('{:2>}{:1}{:1}{:1}{:<2}'.format(row, 'X' , col , '=' , row * col), end='  ')
#     print(' ')
# print('=-='*25)
#
# #===============第四种================
# print('=-='*10,'for循环第四种','=-='*10)
# for row in range(9,0,-1):
#     #生成行坐标：row
#     for col in range(1,10):
#         if row > col:
#             print('{:<6}'.format(''), end='  ')
#         else:
#             print('{:2>}{:1}{:1}{:1}{:<2}'.format(row, 'X' , col , '=' , row * col), end='  ')
#     print(' ')
# print('=-=' * 25)
#
# #==============while循环==============
# #===============第一种================
# print('=-='*10,'while循环第一种','=-='*10)
# row = col = 1
# while(row < 10):
#     while(col <= row) :
#         print('{:2>}{:1}{:1}{:1}{:<2}'.format(row, 'X' , col , '=' , row * col), end='  ')   #pis：end = ''，表示输出这行内容后，不换行
#         col = col + 1
#     row = row + 1
#     print(' ')
#     col = 1
# print('=-='*25)
#
# #===============第二种================
# print('=-='*10,'while循环第二种','=-='*10)
# row = 9
# col = 1
# while(row > 0):
#     while(col <= row) :
#         print('{:2>}{:1}{:1}{:1}{:<2}'.format(row, 'X' , col , '=' , row * col), end='  ')   #pis：end = ''，表示输出这行内容后，不换行
#         col = col + 1
#     row = row - 1
#     print(' ')
#     col = 1
# print('=-='*25)
#
# #===============第三种================
print('=-='*10,'while循环第三种','=-='*10)
row = col = 1
while(row < 10):
    while(col < 10):
        if row > col:
            print('{:<6}'.format(''), end='  ')
        else:
            print('{:2>}{:1}{:1}{:1}{:<2}'.format(row, 'X', col, '=', row * col), end='  ')
        col = col + 1
    print(' ')
    row = row + 1
    col = 1
print('=-=' * 25)
#
# #===============第四种================
# print('=-='*10,'while循环第四种','=-='*10)
# row = 9
# col = 1
# while(row > 0):
#     while(col < 10):
#         if row > col:
#             print('{:<6}'.format(''), end='  ')
#         else:
#             print('{:2>}{:1}{:1}{:1}{:<2}'.format(row, 'X', col, '=', row * col), end='  ')
#         col = col + 1
#     print(' ')
#     row = row - 1
#     col = 1
# print('=-=' * 25)
